#include "stdafx.h"
#include "game/gamemgr.h"
#include "./inputmgr.h"

InputMgr::InputMgr()
{

}

InputMgr::~InputMgr()
{
}

void InputMgr::DoMouseMove(Point pos)
{
	FireEvent(OnMouseInputFunc, OnMouseMove, (WinPosToGamePos(pos)))
}

void InputMgr::DoMouseLButtonDown(Point pos)
{
	FireEvent(OnMouseInputFunc, OnMouseLButtonDown, (WinPosToGamePos(pos)))
}

void InputMgr::DoMouseLButtonUp(Point pos)
{
	FireEvent(OnMouseInputFunc, OnMouseLButtonUp, (WinPosToGamePos(pos)))
}

Point InputMgr::WinPosToGamePos(Point winPos)
{
	Size winSize = GameMgr::GetInstance().GetWinSize();
	return Point(winPos.x * 100 / (float)winSize.cx, 100 - winPos.y * 100 / (float)winSize.cy);
}